home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Win '95 Giga Pack
/
Win95 Giga Pack (Maple Media) (1997).iso
/
COMM
/
Q95DEMO
/
SCRIPTS.Z
/
HOSTUTIL.QSC
< prev
next >
Wrap
Text File
|
1995-11-08
|
2KB
|
55 lines
' Utility routines for host mode.
'
' DO NOT COMPILE THIS FILE BY ITSELF!
'
' This file is a part of the complete HOST.QSC and will not compile
' alone. To recompile the host scripts, select Scripts/Compile from
' the QmodemPro for Windows menu and select HOST.QSC in the "Compile
' script" dialog box. This file will automatically be compiled as
' part of the full script.
const SecondsInDay = 86400
declare sub OemToChar lib "user32" alias "OemToCharA" (src as string, dest as string)
declare sub CharToOem lib "user32" alias "CharToOemA" (src as string, dest as string)
declare function CharUpper lib "user32" alias "CharUpperA" (s as string) as string
function FindLastBackslash(byval fn as string)
dim i as integer
i = len(fn)
do while i > 0 and fn(i) <> "\" and fn(i) <> ":"
i = i - 1
loop
FindLastBackslash = i
end function
function JustPathName(byval pathname as string) as string
dim i as integer
i = FindLastBackslash(pathname)
JustPathName = left(pathname, i)
end function
function JustFilename(byval pathname as string) as string
dim i as integer
i = FindLastBackslash(pathname)
JustFileName = mid(pathname, i+1)
end function
function AddBackSlash(byval dirname as string) as string
dim i as integer
i = len(dirname)
if dirname(i) <> "\" then
dirname = dirname + "\"
end if
AddBackSlash = dirname
end function
function OemUpper(byval s as string) as string
dim buf as string
buf = space(len(s))
call OemToChar(s, buf)
call CharUpper(buf)
call CharToOem(buf, buf)
OemUpper = buf
end function